import { sequelize } from "./sequelize.js";
import { Blog } from "../model/Blog.js";

export async function sync(){
    sequelize.authenticate().then(()=>console.log('连接成功'))
    await sequelize.sync({force:true})

    console.log("同步成功 ");
    
    let blogs=[
        {
            title:'太阳',
            author:'sun'
        },
        {
            title:'太阳',
            author:'sun'
        },
        {
            title:'太阳',
            author:'sun'
        },
        {
            title:'太阳',
            author:'sun'
        }
    ]

    Blog.bulkCreate(blogs)
}

